package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：标签来源类型枚举
 *
 * 根据此类型可以反转找到来源srcid
 *
 * 后续增加需求标签再继续添加
 *
 * @author jun.liu
 */
public enum SrcTypes implements EnumerableValue
{

    LOCAL(0, "后台自建"),
    BRAND(1, "品牌"),
    CATEGORY(2, "类别"),
    PROVINCE(3, "省"),
    CITY(4, "市"),
    ;

    public static class Converter extends BaseEnumValueConverter<SrcTypes>
    {
    }

    private int value;
    private String desc;

    SrcTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static SrcTypes getSexByValue(int codeVal)
    {
        for (SrcTypes sex : SrcTypes.values())
        {
            if (sex.getValue() == codeVal)
            {
                return sex;
            }
        }
        return null;
    }
}
